﻿@model IEnumerable<PostViewModel>
@{
    ViewBag.Title = "Home";
}
@foreach (var x in Model)
{
    <div class="post type-post article">
        <div class="header">
            <div class="title"><a href="/post/@x.Url" title="@x.Title">@x.Title</a></div>
            <div class="info info1">
                <span class="time">@x.Time.ToString()</span>
            </div>
            <div class="info info2">
                <span class="tag">
                    @if (x.CatalogId != null)
                    { 
                        @("分类:")
                        <a asp-action="Catalog" asp-controller="Home" asp-route-id="@x.Catalog.Url">@x.Catalog.Title</a>
                    }
                    
                    标签:
                    @foreach (PostTag y in x.Tags)
                    {
                        <a asp-action="Tag" asp-controller="Home" asp-route-tag="@y.Tag">@y.Tag</a>
                    }
                </span>
            </div>
        </div>
        <div class="section entry">
            @Html.Marked(x.Summary)
        </div>
    </div>
}
<div class="wp-pagenavi">
    <div class="pages">共@((ViewData["PagingInfo"] as PagingInfo).PageCount)页</div>
        @Html.Paging("page larger", "current")
        <div class="clear"></div>
</div>

<script>
    $("#p_@ViewBag.Position").addClass("current_page_item");
</script>
